using UnityEngine;

public class PlayerWallJumpState : EntilyState
{
    public PlayerWallJumpState(StateMachine stateMachine, string animBoolName, Player player) : base(stateMachine, animBoolName, player)
    {
    }

    public override void Enter()
    {
        base.Enter();
        player.SetVelocity(player.wallJumpForce.x*-player.facingDir,player.wallJumpForce.y);
    }

    public override void UpDate()
    {
        base.UpDate();
        if (rb.linearVelocity.y<0)
        {
            stateMachine.ChangeState(player.playerFallState);
        }

        if (player.wallDetected)
        {
            stateMachine.ChangeState(player.playerWallSlideState);
        }
    }
}
